﻿using System;
using System.Collections.Generic;
using System.Text;

using Newtonsoft.Json;

namespace UpYun.Storage.Model
{
    /// <summary>
    /// 视频元信息
    /// </summary>
    public class VideoMetaInformationModel
    {
        /// <summary>
        /// 编码信息
        /// </summary>
        [JsonProperty("streams")]
        public VideoStreamsModel[] Streams { get; set; }

        /// <summary>
        /// 格式
        /// </summary>
        [JsonProperty("format")]
        public VideoFormatModel Format { get; set; }
    }

    /// <summary>
    /// 视频流信息
    /// </summary>
    public class VideoStreamsModel
    {
        /// <summary>
        /// 索引
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; }


        /// <summary>
        /// 帧数
        /// </summary>
        [JsonProperty("video_fps")]
        public int VideoFps { get; set; }

        /// <summary>
        /// 视频高度
        /// </summary>
        [JsonProperty("video_height")]
        public int VideoHeight { get; set; }

        /// <summary>
        /// 视频宽度
        /// </summary>
        [JsonProperty("video_width")]
        public int VideoWidth { get; set; }

        /// <summary>
        /// 音频频道
        /// </summary>
        [JsonProperty("audio_channels")]
        public int AudioChannels { get; set; }

        /// <summary>
        /// 音频采样率
        /// </summary>
        [JsonProperty("audio_samplerate")]
        public int AudioSamplerate { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [JsonProperty("codec")]
        public string Codec { get; set; }

        /// <summary>
        /// 编码描述
        /// </summary>
        [JsonProperty("codec_desc")]
        public string CodecDesc { get; set; }

        /// <summary>
        /// 比特率
        /// </summary>
        [JsonProperty("bitrate")]
        public long Bitrate { get; set; }

        /// <summary>
        /// 时长(秒)
        /// </summary>
        [JsonProperty("duration")]
        public double Duration { get; set; }

        /// <summary>
        /// 元数据
        /// </summary>
        [JsonProperty("metadata")]
        public VideoMetadataModel Metadata { get; set; }
    }

    /// <summary>
    /// 视频元数据
    /// </summary>
    public class VideoMetadataModel
    {

        /// <summary>
        /// 创建日期
        /// </summary>
        [JsonProperty("creation_time")]
        public DateTime CreationTime { get; set; }

        /// <summary>
        /// 处理程序名称
        /// </summary>
        [JsonProperty("handler_name")]
        public string HandlerName { get; set; }

        /// <summary>
        /// 编码器
        /// </summary>
        [JsonProperty("encoder")]
        public string Encoder { get; set; }

        /// <summary>
        /// 语言
        /// </summary>
        [JsonProperty("language")]
        public string Language { get; set; }
    }

    /// <summary>
    /// 视频格式
    /// </summary>
    public class VideoFormatModel
    {
        /// <summary>
        /// 时长(秒)
        /// </summary>
        [JsonProperty("duration")]
        public double Duration { get; set; }

        /// <summary>
        /// 全名
        /// </summary>
        [JsonProperty("fullname")]
        public string FullName { get; set; }

        /// <summary>
        /// 比特率
        /// </summary>
        [JsonProperty("bitrate")]
        public long Bitrate { get; set; }

        /// <summary>
        /// 文件大小(字节)
        /// </summary>
        [JsonProperty("filesize")]
        public long FileSize { get; set; }

        /// <summary>
        /// 格式
        /// </summary>
        [JsonProperty("format")]
        public string Format { get; set; }
    }
}
